package app.view.mediators
{
	import app.AppConstants;
	import app.view.component.EdgeLabeler;
	
	import flare.vis.data.EdgeSprite;
	import flare.vis.data.NodeSprite;
	
	import flash.geom.Point;
	
	import mx.controls.Label;
	
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.mediator.Mediator;

	public class InfoPopUp extends Mediator implements IPopup
	{
		public static const NAME:String = "InfoPopUp";
		
		public function InfoPopUp(viewComponent:Object=null){
			super(NAME, viewComponent);
		}
		
		
		override public function listNotificationInterests():Array{
			return [	AppConstants.NODE_ROLL_OUT,
						AppConstants.NODE_ROLL_OVER
												]
		}
		
		override public function handleNotification(note:INotification):void{
			
			switch( note.getName() ){
				
				case AppConstants.NODE_ROLL_OUT:
					view.removeAllChildren();
					break;
					
				case AppConstants.NODE_ROLL_OVER:
					select( NodeSprite( note.getBody() ) );
					break;
				
			}
		}
		
		private function select( node:NodeSprite ):void{
			
			//node.visitEdges(showText, NodeSprite.OUT_LINKS );
		}
		
		private function showText(edge:EdgeSprite):Boolean{
			
			return false;
		}
		
		private function get view():EdgeLabeler{
			return EdgeLabeler(viewComponent);
		}
		
	}
}